package kaizone.haining.chaobohui.json;

import org.json.JSONObject;

public class UserRegister {
    
    public static final String AUTHKEY = "authKey";
    public static final String CHECKINACTIVITYCOUNT = "checkinActivityCount";
    public static final String FAVORITESUBJECTCOUNT = "favoriteSubjectCount";
    public static final String FOLLOWACTIVITYCOUNT = "followActivityCount";
    public static final String GMTAUTH = "gmtAuth";
    public static final String GMTCREATE = "gmtCreate";
    public static final String GMTMODIFIED = "gmtModified";
    public static final String USERID = "userId";
    public static final String MD5PASSWORD = "md5Password";
    public static final String REGISTERIMEI = "registerIMEI";
    public static final String USERNAME = "userName";
    
    public String authKey;
    public String checkinActivityCount;
    public String favoriteSubjectCount;
    public String followActivityCount;
    public String gmtAuth;
    public String gmtCreate;
    public String gmtModified;
    public int userId;
    public String md5Password;
    public String registerIMEI;
    public String userName;
    
    public static UserRegister parse(JSONObject jsonObject){
        UserRegister register = new UserRegister();
        register.authKey = jsonObject.optString(AUTHKEY);
        register.checkinActivityCount = jsonObject.optString(CHECKINACTIVITYCOUNT);
        register.favoriteSubjectCount = jsonObject.optString(FAVORITESUBJECTCOUNT);
        register.followActivityCount = jsonObject.optString(FOLLOWACTIVITYCOUNT);
        register.gmtAuth = jsonObject.optString(GMTAUTH);
        register.gmtCreate = jsonObject.optString(GMTCREATE);
        register.gmtModified = jsonObject.optString(GMTMODIFIED);
        register.md5Password = jsonObject.optString(MD5PASSWORD);
        register.registerIMEI = jsonObject.optString(REGISTERIMEI);
        register.userName = jsonObject.optString(USERNAME);
        register.userId = jsonObject.optInt(USERID);
        
        return register;
    }

}
